import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//导入Vant
import Vant from 'vant'
import 'vant/lib/index.css'
//导入axios
import axios from 'axios'
import VueAxios from 'vue-axios'

//后端接口的前缀
axios.defaults.baseURL='http://localhost:8888'
//配置请求携带令牌
axios.interceptors.request.use((config) => {
    let token = store.state.token;
    if (token) {
        config.headers.sqtoken = token;
    }
    return config;
});

createApp(App).use(store).use(router).
use(Vant).use(VueAxios, axios).
mount('#app')
